<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        function f() {
            d = new Date();
            var year = d.getFullYear();
            if (year%400 ==0 || (year%4 ==0 && year%100 !=0)) {
                return true;
            }else {
                return false;
            }
        }
        var a = f();
        if (a==true) {
            console.log("是闰年");
        }else {
            console.log("不是闰年");
        }
    </script>
</head>
<body>

</body>
</html>